<?php
error_reporting(0);
$isadmin=1;
include_once '../comm/conn.php';
include 'check.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>

<body topmargin="5" leftmargin="0">
<table width="700" border="0">
<tr>
<td style="padding-left:10px; font-size:20px; color:#990000; font-weight:bold">多多返利系统7.4专用数据库检测修复工具(2012.06.07)</td>
</tr>
<tr>
<td style="padding-left:10px;"><?php
$link = mysql_connect($dbserver, $dbuser, $dbpass);
mysql_query("set names utf8");
mysql_select_db($dbname);
$i=0;$j=0;

$ad = array(
  id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  content=>"`content` varchar(5000) DEFAULT NULL",
  adtype=>"`adtype` varchar(255) DEFAULT NULL",
  addtime=>"`addtime` varchar(255) DEFAULT NULL",
);

$article = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  cid=>"`cid` int(11) DEFAULT NULL",
  title=>"`title` varchar(200) DEFAULT ''",
  subtitle=>"`subtitle` varchar(200) DEFAULT ''",
  att=>"`att` set('a','b','c','d','e','f','g') DEFAULT ''",
  pic=>"`pic` varchar(200) DEFAULT NULL",
  source=>"`source` varchar(200) DEFAULT NULL",
  author=>"`author` varchar(20) DEFAULT NULL",
  resume=>"`resume` varchar(500) DEFAULT NULL",
  pubdate=>"`pubdate` varchar(40) DEFAULT ''",
  content=>"`content` text",
  hits=>"`hits` int(11) DEFAULT '0'",
  created_by=>"`created_by` int(11) DEFAULT NULL",
  created_date=>"`created_date` datetime DEFAULT NULL",
  delete_session_id=>"`delete_session_id` int(11) DEFAULT NULL",
  ontop=>"`ontop` int(11) DEFAULT 0",
  hot=>"`hot` int(11) DEFAULT 0",
);

$category = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  pid=>"`pid` int(11) DEFAULT '0'",
  name=>"`name` varchar(50) DEFAULT ''",
  description=>"`description` text",
  seq=>"`seq` int(11) DEFAULT '0'",
);

$duoduo2010 = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  adminname=>"`adminname` varchar(255) DEFAULT NULL",
  adminpass=>"`adminpass` varchar(255) DEFAULT NULL",
  lastlogintime=>"`lastlogintime` datetime DEFAULT NULL",
  lastloginip=>"`lastloginip` varchar(255) DEFAULT NULL",
  loginnum=>"`loginnum` int(11) DEFAULT '0'",
  logintime=>"`logintime` datetime DEFAULT NULL",
  loginip=>"`loginip` varchar(255) DEFAULT NULL",
  regtime=>"`regtime` datetime default NULL"
);

$file = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  path=>"`path` varchar(255) DEFAULT NULL",
  size=>"`size` varchar(255) DEFAULT NULL",
  upload_date=>"`upload_date` varchar(255) DEFAULT NULL",
);

$mall = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  name=>"`name` varchar(20) DEFAULT NULL",
  merchant=>"`merchant` varchar(20) DEFAULT NULL",
  url=>"`url` varchar(255) DEFAULT NULL",
  logo=>"`logo` varchar(255) DEFAULT NULL",
  catid=>"`catid` int(2) DEFAULT NULL",
  fan=>"`fan` varchar(50) DEFAULT NULL",
  hdfk=>"`hdfk` varchar(10) DEFAULT NULL",
  zgfp=>"`zgfp` varchar(10) DEFAULT NULL",
  yfzc=>"`yfzc` varchar(30) DEFAULT NULL",
  ding=>"`ding` int(10) DEFAULT '0'",
  cai=>"`cai` int(10) DEFAULT '0'",
  des=>"`des` varchar(255) DEFAULT '暂无'",
  js=>"`js` text DEFAULT NULL",
  time=>"`time` varchar(30) DEFAULT NULL",
  sort=>"`sort` int(11) DEFAULT '255'",
  yilink=>"`yilink` VARCHAR(255) NULL DEFAULT NULL",
  lm=>"`lm` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'yiqifa'",
  end_time=>"`end_time` date NOT NULL default '2050-01-01'",
  renzheng=>"`renzheng` varchar(3) NOT NULL",
  api_url=>"`api_url` varchar(255) NOT NULL",
  api_rule=>"`api_rule` varchar(50) NOT NULL",
  api_city=>"`api_city` varchar(255) NOT NULL",
  duomaiid=>"`duomaiid` INT( 11 ) NOT NULL DEFAULT '0'",
  yiqifaid=>"`yiqifaid` INT( 11 ) NOT NULL DEFAULT '0'",
);

$mall_comment = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  mall_name=>"`mall_name` varchar(50) default NULL",
  mall_id=>"`mall_id` int(11) NOT NULL",
  user_name=>"`user_name` varchar(50) default NULL",
  user_id=>"`user_id` int(11) NOT NULL",
  fen=>"`fen` int(1) default NULL",
  comment=>"`comment` text",
  time=>"`time` varchar(20) default NULL",
);

$msgset = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  msg=>"`msg` varchar(2000) DEFAULT NULL",
  type=>"`type` varchar(255) DEFAULT NULL",
);

$mall_order = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  order_time=>"`order_time` varchar(20) DEFAULT NULL",
  merchant_id=>"`merchant_id` varchar(20) DEFAULT NULL",
  u_id=>"`u_id` int(11) DEFAULT '0'",
  ddusername=>"`ddusername` varchar(50) DEFAULT NULL",
  order_code=>"`order_code` varchar(20) DEFAULT NULL",
  item_count=>"`item_count` int(5) DEFAULT NULL",
  item_price=>"`item_price` varchar(10) DEFAULT NULL",
  sales=>"`sales` varchar(20) DEFAULT NULL",
  commission=>"`commission` varchar(10) DEFAULT NULL",
  fxje=>"`fxje` varchar(10) DEFAULT NULL",
  bill_yyyymmdd=>"`bill_yyyymmdd` varchar(20) DEFAULT '0'",
  stat_desc=>"`stat_desc` varchar(10) DEFAULT NULL",
  prod_id=>"`prod_id` varchar(255) DEFAULT NULL",
  qrsj=>"`qrsj` varchar(255) DEFAULT NULL",
  product_code=>"`product_code` VARCHAR( 50 ) NULL",
  'unique_id'=>"`unique_id` VARCHAR( 50 ) NULL DEFAULT NULL",
  'lm'=>"`lm` VARCHAR( 50 ) NULL DEFAULT NULL",
  'adid'=>"`adid` INT( 11 ) NOT NULL DEFAULT '0'",
);

$mingxi = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  ddusername=>"`ddusername` varchar(255) DEFAULT NULL",
  shijian=>"`shijian` varchar(255) DEFAULT NULL",
  je=>"`je` double DEFAULT '0'",
  jifen=>"`jifen` INT( 11 ) NULL DEFAULT '0' AFTER `je`",
  addtime=>"`addtime` datetime DEFAULT NULL",
  memo=>"`memo` varchar(500) DEFAULT NULL",
  leave_money=>"`leave_money` double(10,2) DEFAULT '0'",
);

$msg = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  title=>"`title` varchar(500) DEFAULT NULL",
  content=>"`content` varchar(6000) DEFAULT NULL",
  addtime=>"`addtime` datetime DEFAULT NULL",
  see=>"`see` int(11) DEFAULT '0'",
  ddusername=>"`ddusername` varchar(255) DEFAULT NULL",
  senduser=>"`senduser` varchar(255) DEFAULT NULL",
);

$shop = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  nick=>"`nick` varchar(255) DEFAULT NULL",
  uid=>"`uid` varchar(255) DEFAULT NULL",
  cid=>"`cid` int(10) DEFAULT NULL",
  consumer_protection=>"`consumer_protection` varchar(10) DEFAULT NULL",
  level=>"`level` int(10) DEFAULT NULL",
  score=>"`score` int(11) DEFAULT NULL",
  total_num=>"`total_num` int(11) DEFAULT NULL",
  good_num=>"`good_num` int(11) DEFAULT NULL",
  city=>"`city` varchar(255) DEFAULT NULL",
  state=>"`state` varchar(255) DEFAULT NULL",
  sid=>"`sid` varchar(255) DEFAULT NULL",
  title=>"`title` varchar(255) DEFAULT NULL",
  pic_path=>"`pic_path` varchar(255) DEFAULT NULL",
  created=>"`created` varchar(255) DEFAULT NULL",
  shop_click_url=>"`shop_click_url` varchar(300) DEFAULT NULL",
  type=>"`type` varchar(5) DEFAULT 'C'",
  addtime=>"`addtime` varchar(255) DEFAULT '2007-05-23'",
  hits=>"`hits` int(11) DEFAULT '0'",
  tuijian=>"`tuijian` int(11) DEFAULT '0'",
  item_score=>"`item_score` varchar(255) DEFAULT '4.8'",
  service_score=>"`service_score` varchar(255) DEFAULT '4.8'",
  delivery_score=>"`delivery_score` varchar(255) DEFAULT '4.8'",
  fanxianlv=>"`fanxianlv` varchar(255) DEFAULT NULL",
  good=>"`good` varchar(255) DEFAULT NULL",
);

$slides = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  pic=>"`pic` varchar(255) DEFAULT NULL",
  url=>"`url` varchar(255) DEFAULT NULL",
  title=>"`title` varchar(100) DEFAULT NULL",
  hide=>"`hide` int(11) DEFAULT '0'",
  addtime=>"`addtime` datetime DEFAULT NULL",
  wz=>"`wz` int(11) DEFAULT '10000'",
);

$tixian = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  ddusername=>"`ddusername` varchar(255) DEFAULT NULL",
  txje=>"`txje` double DEFAULT NULL",
  zfb=>"`zfb` varchar(255) DEFAULT NULL",
  addtime=>"`addtime` datetime DEFAULT NULL",
  addip=>"`addip` varchar(255) DEFAULT NULL",
  txstate=>"`txstate` int(11) DEFAULT '0'",
  realname=>"`realname` varchar(255) DEFAULT NULL",
  mobile=>"`mobile` varchar(255) DEFAULT NULL",
  why=>"`why` varchar(500) DEFAULT NULL",
);

$tradelist = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  pay_time=>"`pay_time` datetime DEFAULT NULL",
  item_title=>"`item_title` varchar(255) DEFAULT NULL",
  shop_title=>"`shop_title` varchar(255) DEFAULT NULL",
  num_iid=>"`num_iid` varchar(255) DEFAULT NULL",
  seller_nick=>"`seller_nick` varchar(255) DEFAULT NULL",
  pay_price=>"`pay_price` varchar(255) DEFAULT NULL",
  commission_rate=>"`commission_rate` varchar(255) DEFAULT NULL",
  commission=>"`commission` varchar(255) DEFAULT NULL",
  item_num=>"`item_num` varchar(255) DEFAULT NULL",
  trade_id=>"`trade_id` varchar(255) DEFAULT NULL",
  outer_code=>"`outer_code` varchar(255) DEFAULT NULL",
  qrsj=>"`qrsj` datetime DEFAULT NULL",
  fxje=>"`fxje` double DEFAULT '0'",
  checked=>"`checked` INT( 1 ) NULL DEFAULT '0'",
  ddjt=>"`ddjt` VARCHAR( 255 ) NULL",
  'real_pay_fee'=>"`real_pay_fee` double(10,2) NOT NULL DEFAULT '0.00'",
);

$user = array(
  'Id'=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  'ddusername'=>"`ddusername` varchar(255) DEFAULT NULL",
  'ddpassword'=>"`ddpassword` varchar(255) DEFAULT NULL",
  'tbusername'=>"`tbusername` varchar(255) DEFAULT NULL",
  'regtime'=>"`regtime` datetime DEFAULT NULL",
  'regip'=>'`regip` varchar(20) DEFAULT NULL',
  'loginnum'=>"`loginnum` int(11) DEFAULT '0'",
  'lastlogintime'=>"`lastlogintime` datetime DEFAULT NULL",
  'lasttixian'=>"`lasttixian` datetime DEFAULT NULL",
  'zfb'=>"`zfb` varchar(255) DEFAULT NULL",
  'email'=>"`email` varchar(255) DEFAULT NULL",
  'money'=>"`money` double DEFAULT '0'",
  'txstate'=>"`txstate` int(11) DEFAULT '0'",
  'dengji'=>"`dengji` int(11) DEFAULT '0'",
  'tjr'=>"`tjr` varchar(255) DEFAULT NULL",
  'mobile'=>"`mobile` varchar(255) DEFAULT NULL",
  'qq'=>"`qq` varchar(255) DEFAULT NULL",
  'pass_question'=>"`pass_question` varchar(250) DEFAULT NULL",
  'pass_answer'=>"`pass_answer` varchar(250) DEFAULT NULL",
  'yitixian'=>"`yitixian` double DEFAULT '0'",
  'jifen'=>"`jifen` INT( 11 ) NOT NULL DEFAULT '0' AFTER `money`",
  'dhstate'=>"`dhstate` INT( 1 ) NOT NULL DEFAULT '0' AFTER `txstate`",
  'fxb'=>"`fxb` INT( 1 ) NOT NULL DEFAULT '0'",
  'jihuo'=>"`jihuo` INT( 1 ) NOT NULL DEFAULT '0'",
  'hart'=>"`hart` int(10) NOT NULL default '0'",
);

$websetting = array(
  'Id'=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  'fxbl'=>"`fxbl` double DEFAULT '0.5'",
  'fxbl2'=>"`fxbl2` double DEFAULT '0.6'",
  'fxbl3'=>"`fxbl3` double DEFAULT '0.7'",
  'fxbl4'=>"`fxbl4` double DEFAULT '0.8'",
  'mallfxbl1'=>"`mallfxbl1` double DEFAULT '0.5'",
  'mallfxbl2'=>"`mallfxbl2` double DEFAULT '0.6'",
  'mallfxbl3'=>"`mallfxbl3` double DEFAULT '0.7'",
  'mallfxbl4'=>"`mallfxbl4` double DEFAULT '0.8'",
  'tgbl'=>"`tgbl` double DEFAULT '0.1'",
  'webtitle'=>"`webtitle` varchar(250) DEFAULT NULL",
  'webdesc'=>"`webdesc` varchar(250) DEFAULT NULL",
  'keyword'=>"`keyword` varchar(2000) DEFAULT NULL",
  'description'=>"`description` varchar(2000) DEFAULT NULL",
  'url'=>"`url` varchar(100) DEFAULT NULL",
  'surl'=>"`surl` varchar(100) DEFAULT NULL",
  'email'=>"`email` varchar(100) DEFAULT NULL",
  'icp'=>"`icp` varchar(100) DEFAULT NULL",
  'tongji'=>"`tongji` varchar(1000) DEFAULT NULL",
  'qq'=>"`qq` varchar(50) DEFAULT NULL",
  'webnick'=>"`webnick` varchar(100) DEFAULT NULL",
  'emsg'=>"`emsg` varchar(1500) DEFAULT NULL",
  'gonggao'=>"`gonggao` longtext",
  'renzheng'=>"`renzheng` varchar(1000) DEFAULT NULL",
  'tixianje'=>"`tixianje` double DEFAULT '10'",
  'txxz'=>"`txxz` double DEFAULT '0'",
  'zhucesong'=>"`zhucesong` double DEFAULT '0'",
  'zhucesonglevel'=>"`zhucesonglevel` int(11) DEFAULT '0'",
  'liebiao'=>"`liebiao` varchar(10) DEFAULT '0'",
  'wjt'=>"`wjt` varchar(10) DEFAULT '0'",
  'moresort'=>"`moresort` varchar(255) DEFAULT 'commissionNum_desc'",
  'moban'=>"`moban` varchar(50) DEFAULT 'default'",
  'hcopen'=>"`hcopen` varchar(10) DEFAULT '0'",
  'hctime'=>"`hctime` varchar(10) DEFAULT '10'",
  'dengji1'=>"`dengji1` int(11) DEFAULT '20'",
  'dengji2'=>"`dengji2` int(11) DEFAULT '50'",
  'dengji3'=>"`dengji3` int(11) DEFAULT '100'",
  'shopcj'=>"`shopcj` int(11) DEFAULT '1'",
  'shopcj_s'=>"`shopcj_s` int(11) DEFAULT '11'",
  'shopcj_e'=>"`shopcj_e` int(11) DEFAULT '20'",
  'pagesize'=>"`pagesize` varchar(10) DEFAULT '20'",
  'smtp_host'=>"`smtp_host` varchar(100) DEFAULT NULL",
  'smtp_user'=>"`smtp_user` varchar(100) DEFAULT NULL",
  'smtp_pw'=>"`smtp_pw` varchar(100) DEFAULT NULL",
  'smtp_open'=>"`smtp_open` varchar(10) DEFAULT 'off'",
  'fxbname'=>"`fxbname` varchar(100) DEFAULT '返现宝'",
  'hotword'=>"`hotword` varchar(100) DEFAULT '热卖'",
  'webclose'=>"`webclose` int(11) DEFAULT '0'",
  'webclosemsg'=>"`webclosemsg` varchar(1000) DEFAULT '网站维护中，请稍后再来...'",
  'webtype'=>"`webtype` int(11) DEFAULT '1'",
  'cha'=>"`cha` int(11) DEFAULT '0'",
  'apijk'=>"`apijk` int(11) DEFAULT '0'",
  'apisize'=>"`apisize` int(11) DEFAULT '50'",
  'mallzh'=>"`mallzh`  varchar(100) DEFAULT NULL",
  'mallmm'=>"`mallmm`  varchar(100) DEFAULT NULL",
  'mallwzbh'=>"`mallwzbh`  varchar(100) DEFAULT NULL",
  'uc'=>"`uc` int(11) DEFAULT '0'",
  'gettime'=>"`gettime`  varchar(20) DEFAULT '0'",
  'miyue'=>"`miyue` VARCHAR( 50 ) NULL DEFAULT NULL",
  'jifen_open'=>"`jifen_open` TINYINT( 1 ) NOT NULL DEFAULT '0'",
  'jifenbl'=>"`jifenbl` DOUBLE( 5, 2 ) NOT NULL DEFAULT '0'",
  'zsjifen'=>"`zsjifen` VARCHAR( 5 ) NOT NULL DEFAULT '0'",
  'fxb_open'=>"`fxb_open`int(11) DEFAULT '0'",
  'spider'=>"`spider` VARCHAR(255) DEFAULT NULL",
  'ban_spider_open'=>"`ban_spider_open` int(1) DEFAULT '0'",
  'tao_pj_open'=>"`tao_pj_open` int(1) DEFAULT '1'",
  'tgopen'=>"`tgopen` int(1) DEFAULT '0'",
  'yisid'=>"`yisid`  varchar(20) DEFAULT NULL",
  'yiwid'=>"`yiwid`  varchar(20) DEFAULT NULL",
  'yiname'=>"`yiname`  varchar(50) DEFAULT NULL",
  'tgurl'=>"`tgurl`  varchar(255) DEFAULT NULL",
  'serviceopen'=>"`serviceopen` tinyint(1) DEFAULT '0'",
  'reg_send_email'=>"`reg_send_email` tinyint(1) DEFAULT '0'",
  'tixian_send_email'=>"`tixian_send_email` tinyint(1) DEFAULT '0'",
  'sign_open'=>"`sign_open` tinyint(1) DEFAULT '0'",
  'sign_money'=>"`sign_money` double(5,2) DEFAULT '0'",
  'sign_jifen'=>"`sign_jifen` tinyint(10) DEFAULT '0'",
  'email_jihuo'=>"`email_jihuo` tinyint(1) DEFAULT '0'",
  'urlkey'=>"`urlkey` varchar(255) default NULL",
  'hytxjl'=>"`hytxjl` double(5,2) NOT NULL default '0.00'",
  'duomaimiyue'=>"`duomaimiyue` VARCHAR( 50 ) NULL",
  'duomaiid'=>"`duomaiid` INT( 11 ) NOT NULL DEFAULT '0'",
  'duomaiwid'=>"`duomaiwid` INT( 11 ) NOT NULL DEFAULT '0'",
  'duomaiwbh'=>"`duomaiwbh` VARCHAR( 10 ) NOT NULL DEFAULT '001'",
  'picwjt'=>"`picwjt` TINYINT( 1 ) NOT NULL DEFAULT '0'",
  'picjm'=>"`picjm` TINYINT( 1 ) NOT NULL DEFAULT '0'",
  'searchlimit'=>"`searchlimit` INT( 11 ) NOT NULL DEFAULT '0'",
  'searchs8'=>"`searchlimit` INT( 11 ) NOT NULL DEFAULT '0'",
  'reg_between'=>"`reg_between` DOUBLE( 6, 2 ) NOT NULL DEFAULT '0'",
);

$taobaoset = array(
  id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  appKey=>"`appKey` varchar(255) DEFAULT NULL",
  appSecret=>"`appSecret` varchar(255) DEFAULT NULL",
  appkey2=>"`appkey2` varchar(255) DEFAULT NULL",
  appsecret2=>"`appsecret2` varchar(255) DEFAULT NULL",
  appkey3=>"`appkey3` varchar(255) DEFAULT NULL",
  appsecret3=>"`appsecret3` varchar(255) DEFAULT NULL",
  appkey4=>"`appkey4` varchar(255) DEFAULT NULL",
  appsecret4=>"`appsecret4` varchar(255) DEFAULT NULL",
  appkey5=>"`appkey5` varchar(255) DEFAULT NULL",
  appsecret5=>"`appsecret5` varchar(255) DEFAULT NULL",
  userpid=>"`userpid` varchar(255) DEFAULT NULL",
  usernick=>"`usernick` varchar(255) DEFAULT NULL",
  seckey=>"`seckey` varchar(255) DEFAULT NULL",
  appnum=>"`appnum` int(5) default '200'",
  appnum2=>"`appnum2` int(5) default '0'",
  appnum3=>"`appnum3` int(5) default '0'",
  appnum4=>"`appnum4` int(5) default '0'",
  appnum5=>"`appnum5` int(5) default '0'",
  sessionkey=>"`sessionkey` VARCHAR(100) DEFAULT NULL",
  sessiontime=>"`sessiontime` VARCHAR(20) DEFAULT NULL",
  getkey=>"`getkey` VARCHAR(20) DEFAULT NULL",
  chkey=>"`chkey` int(1) DEFAULT '1'",
);
  
$yqlj = array(
  Id=>"`Id` int(11) NOT NULL AUTO_INCREMENT",
  url=>"`url` varchar(255) DEFAULT NULL",
  webname=>"`webname` varchar(255) DEFAULT NULL",
  addtime=>"`addtime` datetime DEFAULT NULL",
  leibie=>"`leibie` int(11) DEFAULT '0'",
  pic=>"`pic` varchar(255) DEFAULT ''",
  wz=>"`wz` int(11) DEFAULT '0'",
);

$malltype = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  typename=>"`typename` varchar(200) DEFAULT ''",
  typecode=>"`typecode` varchar(200) DEFAULT ''",  
  sort=>"`sort` int(11) DEFAULT '0'",
);

$apilogin = array(
  'dduserid'=>"`dduserid` int(11) NOT NULL",
  'ortheruserid'=>"`ortheruserid` varchar(50) NOT NULL",
  'ortherusername'=>"`ortherusername` varchar(50) NOT NULL",  
  'ortherwebname'=>"`ortherwebname` int(11) DEFAULT '0'",
  'time'=>"`time` varchar(30) NOT NULL",
);

$apireg = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  taoappKey=>"`taoappKey` VARCHAR( 50 ) NULL DEFAULT NULL",
  taoappSecret=>"`taoappSecret` VARCHAR( 50 ) NULL DEFAULT NULL",
  qqappKey=>"`qqappKey` VARCHAR( 50 ) NULL DEFAULT NULL",
  qqappSecret=>"`qqappSecret` VARCHAR( 50 ) NULL DEFAULT NULL",
  qqlappKey=>"`qqlappKey` VARCHAR( 50 ) NULL DEFAULT NULL",
  qqlappSecret=>"`qqlappSecret` VARCHAR( 50 ) NULL DEFAULT NULL",
  sinaappKey=>"`sinaappKey` VARCHAR( 50 ) NULL DEFAULT NULL",
  sinaappSecret=>"`sinaappSecret` VARCHAR( 50 ) NULL DEFAULT NULL",
  alipayappKey=>"`alipayappKey` VARCHAR( 50 ) NULL DEFAULT NULL",
  alipayappSecret=>"`alipayappSecret` VARCHAR( 50 ) NULL DEFAULT NULL",
  kaixinappKey=>"`kaixinappKey` varchar(50) default NULL",
  kaixinappSecret=>"`kaixinappSecret` varchar(100) default NULL",
  taoappon=>"`taoappon` int(1) DEFAULT '0'",
  qqappon=>"`qqappon` int(1) DEFAULT '0'",
  qqlappon=>"`qqlappon` int(1) DEFAULT '0'",
  sinaappon=>"`sinaappon` int(1) DEFAULT '0'",
  alipayappon=>"`alipayappon` int(1) DEFAULT '0'",
  kaixinappon=>"`kaixinappon` int(1) NOT NULL default '0'",
  apireg=>"`apireg` int(1) DEFAULT '0'",
);

$activity = array(
  id=>"`id` int(11) NOT NULL AUTO_INCREMENT",
  mallid=>"`mallid` int(5) NOT NULL",
  mallname=>"`mallname` varchar(50) NOT NULL",
  name=>"`name` varchar(50) NOT NULL",
  pic=>"`pic` varchar(255) NOT NULL",
  stime=>"`stime` varchar(30) NOT NULL",
  etime=>"`etime` varchar(30) NOT NULL",
  url=>"`url` varchar(255) NOT NULL",
  des=>"`des` varchar(500) NOT NULL",
  content=>"`content` text NOT NULL",
  sort=>"`sort` int(10) NOT NULL",
  recommend=>"`recommend` int(1) NOT NULL default '0'",
  time=>"`time` varchar(30) NOT NULL",
);

$dhdingdan = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  name=>"`name` varchar(100) default NULL",
  ddusername=>"`ddusername` varchar(50) default NULL COMMENT '会员名'",
  dduserid=>"`dduserid` int(11) NOT NULL",
  ip=>"`ip` varchar(20) default NULL COMMENT 'IP记录'",
  spid=>"`spid` varchar(18) default NULL COMMENT '商品ID'",
  spend=>"`spend` varchar(10) NOT NULL",
  tbusername=>"`tbusername` varchar(10) NOT NULL COMMENT '姓名'",
  address=>"`address` varchar(100) NOT NULL",
  email=>"`email` varchar(20) default NULL",
  mobile=>"`mobile` varchar(200) default NULL",
  qq=>"`qq` varchar(20) default NULL",
  remarks=>"`remarks` text",
  addtime=>"`addtime` varchar(20) NOT NULL",
  shoptime=>"`shoptime` varchar(20) default NULL",
  status=>"`status` int(1) NOT NULL default '0'",
  fangshi=>"`fangshi` varchar(10) NOT NULL",
  return_msg=>"`return_msg` varchar(500) default NULL",
);

$dhlist = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  pic=>"`pic` varchar(255) default NULL",
  jifen=>"`jifen` int(50) default NULL",
  money=>"`money` varchar(6) NOT NULL",
  name=>"`name` varchar(100) default NULL",
  hide=>"`hide` int(11) default '0'",
  addtime=>"`addtime` datetime default NULL",
  sort=>"`sort` int(3) default '0'",
  content=>"`content` text",
  num=>"`num` int(5) NOT NULL default '1'",
  recommend=>"`recommend` int(1) NOT NULL default '0'",
);

$nav = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  name=>"`name` varchar(20) collate utf8_bin NOT NULL",
  link=>"`link` varchar(500) collate utf8_bin NOT NULL",
  sort=>"`sort` int(5) NOT NULL default '0'",
  hide=>"`hide` tinyint(1) NOT NULL default '0'",
  auto=>"`auto` tinyint(1) NOT NULL default '0'",
  target=>"`target` tinyint(1) NOT NULL default '0'",
  tag=>"`tag` varchar(10) collate utf8_bin NOT NULL",
);

$tempdata = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  commission=>"`commission` double(10,2) DEFAULT '0'",
  carry=>"`carry` double(10,2) DEFAULT '0'",
  userfunds=>"`userfunds` double(10,2) DEFAULT '0'",
  userno=>"`userno` int(11) DEFAULT '0'"
);

$catelist = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  catename=>"`catename` varchar(32) NOT NULL",
  sortorder=>"`sortorder` int(5) NOT NULL default '0'",
  keywords=>"`keywords` text",
);

$city = array(
  cityid=>"`cityid` int(11) NOT NULL auto_increment",
  cityname=>"`cityname` varchar(32) NOT NULL",
  sortorder=>"`sortorder` int(5) NOT NULL default '0'",
  pinyin=>"`pinyin` varchar(32)  NOT NULL default ''",
  first_word=>"`first_word` varchar(1)  NOT NULL",
  isshow=>"`isshow` int(1) NOT NULL default '0'",
);

$setting = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  'var'=>"`var` varchar(50) NOT NULL",
  'constant'=>"`constant` int(1) NOT NULL default '1'",
);

$tuan_goods = array(
  id=>"`id` int(11) NOT NULL auto_increment",
  local=>"`local` varchar(255) default NULL",
  mall_id=>"`mall_id` int(11) NOT NULL default '0'",
  city=>"`city` varchar(50) default NULL",
  catname=>"`catname` varchar(50) default NULL",
  title=>"`title` varchar(255) default NULL",
  image=>"`image` varchar(255) default NULL",
  startTime=>"`startTime` int(50) default NULL",
  endTime=>"`endTime` int(50) default NULL",
  value=>"`value` double(10,2) NOT NULL default '0.00'",
  price=>"`price` double(10,2) NOT NULL default '0.00'",
  rebate=>"`rebate` double(10,1) NOT NULL default '0.0'",
  bought=>"`bought` int(10) NOT NULL default '0'",
  addtime=>"`addtime` varchar(50) default NULL",
  editime=>"`editime` varchar(50) default NULL",
  'sort'=>"`sort` int(10) NOT NULL default '0'",
  'top'=>"`top` int(1) NOT NULL default '0'",
  salt=>"`salt` int(6) NOT NULL default '1'",
  content=>"`content` text",
);

$service=array(
  'id'=>"`id` int(5) NOT NULL auto_increment",
  'name'=>"`name` varchar(50) character set utf8 NOT NULL",
  'code'=>"`code` varchar(50) character set utf8 NOT NULL",
  'type'=>"`type` tinyint(1) NOT NULL"
);

$seo=array(
  'id'=>"`id` int(11) NOT NULL auto_increment",
  'tag'=>"`tag` varchar(255) default NULL",
  'url'=>"`url` varchar(255) default NULL",
  'title'=>"`title` varchar(255) default NULL",
  'keyword'=>"`keyword` varchar(255) default NULL",
  'desc'=>"`desc` varchar(255) default NULL",
  'label'=>"`label` text",
  'del'=>"`del` tinyint(4) default '0'"
);

$shai=array(
  'id'=>"`id` int(11) NOT NULL auto_increment",
  'ddusername'=>"`ddusername` varchar(50) character set utf8 NOT NULL",
  'dduserid'=>"`dduserid` int(11) NOT NULL",
  'tao_id'=>"`tao_id` bigint(12) NOT NULL",
  'trade_id'=>"`trade_id` int(11) NOT NULL default '0'",
  'image'=>"`image` varchar(255) collate utf8_bin default NULL",
  'title'=>"`title` varchar(100) character set utf8 default NULL",
  'price'=>"`price` double(10,2) NOT NULL default '0.00'",
  'fxje'=>"`fxje` double(10,2) NOT NULL default '0.00'",
  'jifen'=>"`jifen` int(11) NOT NULL default '0'",
  'catid'=>"`catid` int(2) NOT NULL default '1'",
  'isfan'=>"`isfan` int(1) NOT NULL default '0'",
  'url'=>"`url` varchar(255) collate utf8_bin default NULL",
  'click_url'=>"`click_url` varchar(255) collate utf8_bin default NULL",
  'keywords'=>"`keywords` varchar(100) character set utf8 default NULL",
  'comment'=>"`comment` varchar(500) character set utf8 default NULL",
  'xs'=>"`xs` char(5) collate utf8_bin NOT NULL default 'shai'",
  'hart'=>"`hart` int(10) NOT NULL default '0'",
  'hits'=>"`hits` int(11) NOT NULL default '0'",
  'time'=>"`time` int(15) NOT NULL",
  'sort'=>"`sort` int(11) NOT NULL default '0'",
);

$shai_comment=array(
  'id'=>"`id` int(11) NOT NULL auto_increment",
  'shai_id'=>"`shai_id` int(11) NOT NULL",
  'xs'=>"`xs` char(5) collate utf8_bin NOT NULL default 'shai'",
  'comment'=>"`comment` varchar(140) character set utf8 NOT NULL",
  'time'=>"`time` int(15) NOT NULL",
  'dduserid'=>"`dduserid` int(11) NOT NULL",
  'ddusername'=>"`ddusername` varchar(50) collate utf8_bin NOT NULL",
);

$shai_hart=array(
  'id'=>"`id` int(11) NOT NULL auto_increment",
  'shai_id'=>"`shai_id` int(11) NOT NULL",
  'xs'=>"`xs` char(5) collate utf8_bin NOT NULL default 'shai'",
  'time'=>"`time` int(15) NOT NULL",
  'dduserid'=>"`dduserid` int(11) NOT NULL",
);

$noword=array(
  'id'=>"`id` int(11) NOT NULL auto_increment",
  'word'=>"`word` varchar(255) NOT NULL"
);

$shai_blacklist=array(
  'tao_id'=>"`tao_id` bigint(12) NOT NULL",
  'time'=>"`time` bigint(15) NOT NULL"
);

function repair_table($table){
	global $ad,$article,$category,$duoduo2010,$file,$mall,$mall_comment,$msgset,$mall_order,$mingxi,$msg,$shop,$slides,$tixian,$tradelist,$user,$websetting,$taobaoset,$yqlj,$malltype,$apilogin,$apireg,$activity,$dhdingdan,$dhlist,$nav,$tempdata,$catelist,$city,$setting,$tuan_goods,$role,$access,$menu,$adminlog,$service,$seo,$shai,$shai_comment,$shai_hart,$noword,$shai_blacklist,$BIAOTOU;
	$j=0;
	foreach($$table as $k=>$myfield){
		if($i==0){$primary_key=$k;}
		$subsql=$subsql.$myfield.",";
		$i++;
	}
	$sql="CREATE TABLE `".$BIAOTOU.$table."`(".$subsql." PRIMARY KEY (`".$primary_key."`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
	mysql_query($sql);
	echo " <font color=#ff0000>已修复</font>";
}

function repair_field($retable,$field){
	global $ad,$article,$category,$duoduo2010,$file,$mall,$mall_comment,$msgset,$mall_order,$mingxi,$msg,$shop,$slides,$tixian,$tradelist,$user,$websetting,$taobaoset,$yqlj,$malltype,$apilogin,$apireg,$activity,$dhdingdan,$dhlist,$nav,$tempdata,$catelist,$city,$setting,$tuan_goods,$role,$access,$menu,$adminlog,$service,$seo,$shai,$shai_comment,$shai_hart,$noword,$shai_blacklist,$BIAOTOU;
	if($retable=="ad"){$table=$ad;}
	if($retable=="article"){$table=$article;}
	if($retable=="category"){$table=$category;}
	if($retable=="duoduo2010"){$table=$duoduo2010;}
	if($retable=="file"){$table=$file;}
	if($retable=="mall"){$table=$mall;}
	if($retable=="mall_comment"){$table=$mall_comment;}
	if($retable=="msgset"){$table=$msgset;}
	if($retable=="mall_order"){$table=$mall_order;}
	if($retable=="mingxi"){$table=$mingxi;}
	if($retable=="msg"){$table=$msg;}
	if($retable=="shop"){$table=$shop;}
	if($retable=="slides"){$table=$slides;}
	if($retable=="tixian"){$table=$tixian;}
	if($retable=="tradelist"){$table=$tradelist;}
	if($retable=="user"){$table=$user;}
	if($retable=="websetting"){$table=$websetting;}
	if($retable=="taobaoset"){$table=$taobaoset;}
	if($retable=="yqlj"){$table=$yqlj;}
	if($retable=="malltype"){$table=$malltype;}
	if($retable=="apilogin"){$table=$apilogin;}
	if($retable=="apireg"){$table=$apireg;}
	if($retable=="activity"){$table=$activity;}
	if($retable=="dhdingdan"){$table=$dhdingdan;}
	if($retable=="dhlist"){$table=$dhlist;}
	if($retable=="nav"){$table=$nav;}
	if($retable=="tempdata"){$table=$tempdata;}
	if($retable=="catelist"){$table=$catelist;}
	if($retable=="city"){$table=$city;}
	if($retable=="setting"){$table=$setting;}
	if($retable=="tuan_goods"){$table=$tuan_goods;}
	if($retable=="role"){$table=$role;}
	if($retable=="access"){$table=$access;}
	if($retable=="menu"){$table=$menu;}
	if($retable=="adminlog"){$table=$adminlog;}
	if($retable=="seo"){$table=$seo;}
	if($retable=="service"){$table=$service;}
	if($retable=="shai"){$table=$shai;}
	if($retable=="shai_comment"){$table=$shai_comment;}
	if($retable=="shai_hart"){$table=$shai_hart;}
	if($retable=="noword"){$table=$noword;}
	if($retable=="shai_blacklist"){$table=$shai_blacklist;}
	$sql="ALTER TABLE `".$BIAOTOU.$retable."` add ".$table["$field"].";";
	mysql_query($sql);
	echo " <font color=#ff0000>已修复</font><br>";echo $sql;
}

echo '<span style="font-weight:bold; color:#ff6600; font-size:12px;">开始检测数据库基础表......</span><br>';
$rs=mysql_query("show tables like '".$BIAOTOU."ad';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."ad ...";repair_table("ad");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."article';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."article... ";repair_table("article");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."category';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."category... ";repair_table("category");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."file';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."file... ";repair_table("file");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."mall';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."mall... ";repair_table("mall");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."mall_comment';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."mall_comment... ";repair_table("mall_comment");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."mall_order';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."mall_order... ";repair_table("mall_order");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."malltype';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."malltype... ";repair_table("malltype");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."mingxi';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."mingxi... ";repair_table("mingxi");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."msg';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."msg... ";repair_table("msg");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."msgset';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."msgset... ";repair_table("msgset");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."shop';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."shop... ";repair_table("shop");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."slides';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."slides... ";repair_table("slides");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."taobaoset';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."taobaoset... ";repair_table("taobaoset");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."tixian';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."tixian... ";repair_table("tixian");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."tradelist';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."tradelist... ";repair_table("tradelist");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."user';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."user... ";repair_table("user");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."websetting';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."websetting... ";repair_table("websetting");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."yqlj';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."yqlj... ";repair_table("yqlj");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."duoduo2010';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."duoduo2010... ";repair_table("duoduo2010");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."apilogin';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."apilogin... ";repair_table("apilogin");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."apireg';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."apireg... ";repair_table("apireg");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."activity';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."activity... ";repair_table("activity");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."dhdingdan';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."dhdingdan... ";repair_table("dhdingdan");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."dhlist';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."dhlist... ";repair_table("dhlist");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."nav';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."nav... ";repair_table("nav");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."tempdata';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."tempdata... ";repair_table("tempdata");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."catelist';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."catelist... ";repair_table("catelist");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."city';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."city... ";repair_table("city");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."setting';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."setting... ";repair_table("setting");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."tuan_goods';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."tuan_goods... ";repair_table("tuan_goods");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."role';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."role... ";repair_table("role");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."access';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."access... ";repair_table("access");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."menu';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."menu... ";repair_table("menu");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."adminlog';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."adminlog... ";repair_table("adminlog");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."seo';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."seo... ";repair_table("seo");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."service';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."service... ";repair_table("service");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."shai';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."shai... ";repair_table("shai");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."shai_comment';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."shai_comment... ";repair_table("shai_comment");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."shai_hart';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."shai_hart... ";repair_table("shai_hart");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."noword';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."noword... ";repair_table("noword");$i++;}

$rs=mysql_query("show tables like '".$BIAOTOU."shai_blacklist';");	
if(mysql_num_rows($rs)==0){echo "缺少表".$BIAOTOU."shai_blacklist... ";repair_table("shai_blacklist");$i++;}

if($i==0){echo " 数据表正常！";}

echo '<span style="font-weight:bold; color:#ff6600; font-size:12px;"><br>开始检测数据库基础表表内字段......</span><br>';
$rs=mysql_query("show fields from `".$BIAOTOU."ad`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","content","adtype","addtime");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."ad中缺少字段".$myfield."... ";repair_field("ad",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."article`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","cid","title","subtitle","att","pic","source","author","resume","pubdate","content","hits","created_by","created_date","delete_session_id","ontop","hot");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."article中缺少字段".$myfield."... ";repair_field("article",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."category`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","pid","name","description","seq");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."category中缺少字段".$myfield."... ";repair_field("category",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."duoduo2010`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","adminname","adminpass","lastlogintime","lastloginip","loginnum","logintime","loginip","regtime");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."duoduo2010中缺少字段".$myfield."... ";repair_field("duoduo2010",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."file`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","path","size","upload_date");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."file中缺少字段".$myfield."... ";repair_field("file",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."mall`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","name","merchant","duomaiid","yiqifaid","url","logo","catid","fan","hdfk","zgfp","yfzc","ding","cai","des","js","time","sort","yilink","lm","renzheng","end_time","api_url","api_rule","api_city");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."mall中缺少字段".$myfield."... ";repair_field("mall",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."mall_comment`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","mall_id","mall_name","user_name","user_id","fen","comment","time");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."mall_comment中缺少字段".$myfield."... ";repair_field("mall_comment",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."mall_order`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","order_time","merchant_id","u_id","ddusername","order_code","item_count","item_price","sales","commission","fxje","bill_yyyymmdd","stat_desc","prod_id","qrsj","product_code","unique_id","lm","adid");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."mall_order中缺少字段".$myfield."... ";repair_field("mall_order",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."malltype`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","typename","typecode","sort");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."ad中缺少字段".$myfield."... ";repair_field("ad",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."mingxi`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","ddusername","shijian","je","jifen","addtime","memo","leave_money");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."mingxi中缺少字段".$myfield."... ";repair_field("mingxi",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."msg`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","title","content","addtime","see","ddusername","senduser");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."msg中缺少字段".$myfield."... ";repair_field("msg",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."msgset`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","msg","type");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."msgset中缺少字段".$myfield."... ";repair_field("msgset",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."shop`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","nick","uid","cid","consumer_protection","level","score","total_num","good_num","city","state","sid","title","pic_path","created","shop_click_url","type","addtime","hits","tuijian","item_score","service_score","delivery_score","fanxianlv","good");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."shop中缺少字段".$myfield."... ";repair_field("shop",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."slides`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","pic","url","title","hide","addtime","wz");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."slides中缺少字段".$myfield."... ";repair_field("slides",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."taobaoset`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","appKey","appSecret","appkey2","appsecret2","appkey3","appsecret3","appkey4","appsecret4","appkey5","appsecret5","userpid","usernick","seckey",'appnum','appnum2','appnum3','appnum4','appnum5',"sessionkey","sessiontime","getkey","chkey");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."taobaoset中缺少字段".$myfield."... ";repair_field("taobaoset",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."tixian`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","ddusername","txje","zfb","addtime","addip","txstate","realname","mobile","why");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."tixian中缺少字段".$myfield."... ";repair_field("tixian",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."tradelist`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","pay_time","item_title","shop_title","num_iid","seller_nick","pay_price","commission_rate","commission","item_num","trade_id","outer_code","qrsj","fxje","checked","ddjt","real_pay_fee");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."tradelist中缺少字段".$myfield."... ";repair_field("tradelist",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."user`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","ddusername","ddpassword","tbusername","regtime","loginnum","lastlogintime","lasttixian","zfb","email","money","txstate","dengji","tjr","mobile","qq","pass_question","pass_answer","yitixian","jifen","dhstate","fxb","jihuo","hart","regip");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."user中缺少字段".$myfield."... ";repair_field("user",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."websetting`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","fxbl","fxbl2","fxbl3","fxbl4","mallfxbl1","mallfxbl2","mallfxbl3","mallfxbl4","tgbl","webtitle","webdesc","keyword","description","url","surl","email","icp","tongji","qq","webnick","emsg","gonggao","renzheng","tixianje","txxz","zhucesong","zhucesonglevel","liebiao","wjt","moresort","moban","hcopen","hctime","dengji1","dengji2","dengji3","shopcj","shopcj_s","shopcj_e","pagesize","smtp_host","smtp_user","smtp_pw","smtp_open","fxbname","hotword","webclose","webclosemsg","webtype","cha","apisize","mallzh","mallmm","mallwzbh","uc","apijk","gettime","miyue","jifen_open","jifenbl","zsjifen","fxb_open","spider","ban_spider_open","tao_pj_open","tgopen","yisid","yiwid","yiname","tgurl","serviceopen",'reg_send_email','tixian_send_email','sign_open','sign_money','sign_jifen','email_jihuo','reg_send_email','tixian_send_email','sign_open','sign_money','sign_jifen','urlkey','hytxjl','duomaimiyue','duomaiid','duomaiwid','duomaiwbh','picwjt','picjm','searchlimit','searchs8','reg_between');
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."websetting中缺少字段".$myfield."... ";repair_field("websetting",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."yqlj`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("Id","url","webname","addtime","leibie","pic","wz");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."yqlj中缺少字段".$myfield."... ";repair_field("yqlj",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."apilogin`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("dduserid","ortheruserid","ortherusername","ortherwebname","time");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."apilogin中缺少字段".$myfield."... ";repair_field("apilogin",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."apireg`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","taoappKey","taoappSecret","qqappKey","qqappSecret","qqlappKey","qqlappSecret","sinaappKey","sinaappSecret","alipayappKey","alipayappSecret","kaixinappKey","kaixinappSecret","taoappon","qqappon","qqlappon","sinaappon","alipayappon","kaixinappon","apireg");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."apireg中缺少字段".$myfield."... ";repair_field("apireg",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."activity`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","mallid","mallname","name","pic","stime","etime","url","des","content","sort","recommend","time");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."activity中缺少字段".$myfield."... ";repair_field("activity",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."dhdingdan`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","name","ddusername","dduserid","ip","spid","spend","tbusername","address","email","mobile","qq","remarks","addtime","shoptime","status","fangshi","return_msg");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."dhdingdan中缺少字段".$myfield."... ";repair_field("dhdingdan",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."dhlist`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","pic","jifen","money","name","hide","addtime","sort","content","num","recommend");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."dhlist中缺少字段".$myfield."... ";repair_field("dhlist",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."nav`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","name","link","sort","hide","auto","target","tag");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."nav中缺少字段".$myfield."... ";repair_field("nav",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."tempdata`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","commission","carry","userfunds","userno");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."tempdata中缺少字段".$myfield."... ";repair_field("tempdata",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."catelist`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","catename","sortorder","keywords");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."catelist中缺少字段".$myfield."... ";repair_field("catelist",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."city`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("cityid","cityname","sortorder","pinyin","first_word","isshow");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."city中缺少字段".$myfield."... ";repair_field("city",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."setting`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","var","val","constant");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."setting中缺少字段".$myfield."... ";repair_field("setting",$myfield);$j++;}
}
unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."tuan_goods`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","local","mall_id","city","catname","title","image","startTime","endTime","value","price","rebate","bought","addtime","editime","sort","salt","top","content");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."tuan_goods中缺少字段".$myfield."... ";repair_field("tuan_goods",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."role`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","name","status");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."role中缺少字段".$myfield."... ";repair_field("role",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."access`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("role_id","menu_id","parentid");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."access中缺少字段".$myfield."... ";repair_field("access",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."menu`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","parentid","status","name","url","listorder");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."menu中缺少字段".$myfield."... ";repair_field("menu",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."adminlog`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","admin_name","ip","act_name","time");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."adminlog中缺少字段".$myfield."... ";repair_field("adminlog",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."service`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","name","code","type");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."service中缺少字段".$myfield."... ";repair_field("service",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."seo`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","tag","url","title","keyword","desc","label","del");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."seo中缺少字段".$myfield."... ";repair_field("seo",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."shai`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","ddusername","dduserid","tao_id","trade_id","image","title","price","fxje","jifen","catid","isfan","url","click_url","keywords","comment","xs","hart","hits","time","sort");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."shai中缺少字段".$myfield."... ";repair_field("shai",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."shai_comment`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","shai_id","xs","comment","time","dduserid","ddusername");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."shai_comment中缺少字段".$myfield."... ";repair_field("shai_comment",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."shai_hart`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","shai_id","xs","dduserid","time");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."shai_hart中缺少字段".$myfield."... ";repair_field("shai_hart",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."noword`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("id","word");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."noword中缺少字段".$myfield."... ";repair_field("noword",$myfield);$j++;}
}

unset($data);
$rs=mysql_query("show fields from `".$BIAOTOU."shai_blacklist`;");
while($row=mysql_fetch_array($rs)){$data[]=$row['Field'];}
$myarr = array("tao_id","time");
foreach($myarr as $myfield){
	if(!in_array($myfield,$data)){echo "表".$BIAOTOU."shai_blacklist中缺少字段".$myfield."... ";repair_field("shai_blacklist",$myfield);$j++;}
}

if($j==0){echo " 数据表内字段正常！<br>";}

mysql_close($link);
?>
</td>
</tr>
<tr>
<td style="padding-left:10px; color:#999999; line-height:25px;"><br><br>如果您的数据库缺少字段，可能是你的数据库被破坏或没有运行升级文件。<br>
1、如果你是升级后出现：说明你没有运行升级文件。<br>
2、如果是平时出现：可能数据库被破坏。<br>
3、如果是恢复数据后出现，可能你的数据库被还原到老版本了。<br>
4、如果无法确定提交论坛寻求帮助。
</td>
</tr>
</table>
</body>
</html>